/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { ArticleAddRequest } from '../models/ArticleAddRequest';
import type { ArticleAuditRequest } from '../models/ArticleAuditRequest';
import type { ArticleQueryRequest } from '../models/ArticleQueryRequest';
import type { ArticleUpdateRequest } from '../models/ArticleUpdateRequest';
import type { BaseResponse_ArticleVO_ } from '../models/BaseResponse_ArticleVO_';
import type { BaseResponse_boolean_ } from '../models/BaseResponse_boolean_';
import type { BaseResponse_long_ } from '../models/BaseResponse_long_';
import type { BaseResponse_Page_ArticleVO_ } from '../models/BaseResponse_Page_ArticleVO_';
import type { BaseResponse_string_ } from '../models/BaseResponse_string_';
import type { DeleteRequest } from '../models/DeleteRequest';

import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';

export class ArticleControllerService {

    /**
     * 添加文章
     * @param articleAddRequest articleAddRequest
     * @returns BaseResponse_long_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static addArticleUsingPost(
articleAddRequest: ArticleAddRequest,
): CancelablePromise<BaseResponse_long_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/article/add',
            body: articleAddRequest,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * 审批
     * @param articleAuditRequest articleAuditRequest
     * @returns BaseResponse_boolean_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static auditArticleUsingPost(
articleAuditRequest: ArticleAuditRequest,
): CancelablePromise<BaseResponse_boolean_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/article/audit',
            body: articleAuditRequest,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * 上下架文章
     * @param deleteRequest deleteRequest
     * @returns BaseResponse_boolean_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static deleteArticleUsingPost(
deleteRequest: DeleteRequest,
): CancelablePromise<BaseResponse_boolean_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/article/delete',
            body: deleteRequest,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * 根据文章id，获取驳回原因
     * @param id id
     * @returns BaseResponse_string_ OK
     * @throws ApiError
     */
    public static getRejectReasonByIdUsingGet(
id?: number,
): CancelablePromise<BaseResponse_string_> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/api/article/get/result',
            query: {
                'id': id,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * 根据id获取文章
     * @param id id
     * @returns BaseResponse_ArticleVO_ OK
     * @throws ApiError
     */
    public static getArticleByIdUsingGet(
id: number,
): CancelablePromise<BaseResponse_ArticleVO_> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/api/article/getById/{id}',
            path: {
                'id': id,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * 分页获取文章列表（文章管理）
     * @param articleQueryRequest articleQueryRequest
     * @returns BaseResponse_Page_ArticleVO_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static listArticleByPageUsingPost(
articleQueryRequest: ArticleQueryRequest,
): CancelablePromise<BaseResponse_Page_ArticleVO_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/article/list/page',
            body: articleQueryRequest,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * 分页获取文章列表（推荐页）
     * @param articleQueryRequest articleQueryRequest
     * @returns BaseResponse_Page_ArticleVO_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static listRecommendByPageUsingPost(
articleQueryRequest: ArticleQueryRequest,
): CancelablePromise<BaseResponse_Page_ArticleVO_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/article/list/recommend/page',
            body: articleQueryRequest,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * 更新文章
     * @param articleUpdateRequest articleUpdateRequest
     * @returns BaseResponse_boolean_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static updateArticleUsingPost(
articleUpdateRequest: ArticleUpdateRequest,
): CancelablePromise<BaseResponse_boolean_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/article/update',
            body: articleUpdateRequest,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

}
